<template>
  <div class="van-coupon grideWrap">
    <van-grid :column-num="4" :border="false">
      <van-grid-item
        v-for="item in categoryOptions"
        :key="item.projectGaugeTypeId"
        @click="toClassify(item.projectGaugeTypeId)"
      >
        <div
          class="van-grid-item__content van-grid-item__content--center"
          style="padding: 0"
        >
          <i class="van-badge__wrapper van-icon van-grid-item__icon">
            <img
              style="width: 50px; height: 50px"
              class="van-icon__image"
              :src="item.imgUrl"
            />
          </i>
          <span class="van-grid-item__text">{{ item.typeName }}</span>
        </div>
      </van-grid-item>
    </van-grid>
  </div>
</template>

<script lang="ts" setup>
import { useRouter } from 'vue-router'

const router = useRouter()

interface Props {
  categoryOptions: any[]
}

const props = defineProps<Props>()

const toClassify = (id: string) => {
  router.push({
    name: 'Classify',
    query: {
      projectGaugeTypeId: id,
    },
  })
}
</script>

<style lang="less" scoped>
@import '../style/evaluation.less';
</style>
